

const path = require('path');
const staticImg = path.join(__dirname, 'static');

function ArduinoUnoBlocks(Blockly) {
    var base_color = "#179b73";



    //滑动电位器
    Blockly.Blocks.microbit_slipresistance = {
        init:function(){
        this.setColour(base_color);
        this.appendDummyInput("")
        .appendField(new Blockly.FieldImage(staticImg+"/32.Slide  Potentiometer.svg", 84, 42))
            .appendField(Blockly.Msg.MICROBIT_PIN)
            .appendField(new Blockly.FieldDropdown([
                ['P0', "pin0"],
                ['P1', "pin1"],
                ['P2', "pin2"],
            ]),"slipresistance")
            .appendField(Blockly.Msg.MICROBIT_READSLIPRESISTANCE)
        this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
            this.setOutput(true, 'Number');
        this.setTooltip('');
        }
    };

    return Blockly;
}

module.exports = ArduinoUnoBlocks;

